{% extends 'bootstrap/base.html' %}
{#导入表单必要元素#}
{% import 'bootstrap/wtf.html' as wtf %}
{#  启用宏模块 ,在模板中导入，便于所有的页面导入  #}
{% from 'common/macro.html' import pagination_show %}
{% block title %}博客中心{% endblock %}
{% block styles %}
    {{ super() }}
    <link rel="icon" href="{{ url_for('static', filename='img/favicon.ico') }}" />
{% endblock %}
{% block content %}
    <nav class="navbar navbar-inverse" style="border-radius: 0;">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{{ url_for('main.index') }}">首页</a>
            </div>
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
{#                    <li><a href="#"><img src="{{ url_for('static',filename='img/xxx.png') }}" style="width: 16px;"></a></li>#}
{#                    <li><a href="#">板块二</a></li>#}
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <form class="navbar-form navbar-left">
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="Search">
                            </div>
                            <button type="submit" class="btn btn-default">查询</button>
                        </form>
                    </li>
                    {% if current_user.is_authenticated %}
                        <li><a href="{{ url_for('user.logout') }}">退出</a></li>
                        <li><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                               aria-haspopup="true" aria-expanded="false" style="font-size: 20px;">{{ current_user.username }}&nbsp<img src="{{ url_for('static',filename='upload/'+current_user.icon) }}" style="height: 20px;border-radius: 50%"><span
                                class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="{{ url_for('user.profile') }}">个人信息</a></li>
                                <li><a href="{{ url_for('user.userposts') }}">我的帖子</a></li>
                                <li><a href="{{ url_for('user.changepawd') }}">修改密码</a></li>
                                <li><a href="{{ url_for('user.changeicon') }}">修改头像</a></li>
                                <li><a href="{{ url_for('user.changeemail') }}">修改邮箱</a></li>
                            </ul>
                        </li>
                    {% else %}
                        <li><a href="{{ url_for('user.login') }}">登录</a></li>
                        <li><a href="{{ url_for('user.register') }}">注册</a></li>
                    {% endif %}
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
    <div class="container">
        {#    展示flash消息#}
        {% for message in get_flashed_messages() %}
            <div class="alert alert-warning alert-dismissible" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                {{ message }}
            </div>
        {% endfor %}
        {% block page_content %}
            <h1>默认内容</h1>
        {% endblock %}
    </div>
{% endblock %}
{% block scripts %}
    {#        使用格式化的时间  #}
    {{ super() }}
    {{ moment.include_jquery() }}
    {{ moment.include_moment() }}
    {{ moment.lang('zh-CN') }}
{% endblock %}